import React, { Component } from 'react'
import {Switch, Route, NavLink, Redirect} from 'react-router-dom'
import Small1 from './Small1'
import Small2 from './Small2'
import Small3 from './Small3'

export default class Big extends Component {
  render() {
    return (
      <div>
        <Redirect to="/big/small1"></Redirect>
        <p>我是父组件，我的页面中嵌套了会切换的子组件</p>
        <Switch>
          <Route path="/big/small1" exact component={Small1} />
          <Route path="/big/small2" component={Small2} />
          <Route path="/big/small3" component={Small3} />
        </Switch>
        <NavLink to="/big/small1">Small1</NavLink>
        <NavLink to="/big/small2">Small2</NavLink>
        <NavLink to="/big/small3">Small3</NavLink>
      </div>
    )
  }
}
